<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/bootstrap-responsive.css">
	<link rel="stylesheet" href="../css/docs.css">
	<style type="text/css" >
		body{
			background:url(../img/2.jpg) center center fixed;
			font-family: Trebuchet MS,Liberation Sans,DejaVu Sans,sans-serif;

		}
		.mya{
			display:block;
			height:25px;
			width:210px;
			padding:2px;
			padding-left: 35px;
			line-height: 25px;
			border-bottom: 1px dotted #000;
			margin-top:0px;
		}

		.mya:hover{
			background-color: #0080C0;
			color:#fff;
			text-decoration: none;

		}
		.row-fluid ul{
			margin-bottom: 0px;

		}
		.bg{
			background-color:#53120C;
		}
	</style>
	
	
</head>
<body>
	
		<%@ include file="include/top.jsp" %>
			
		<!-- 这边是修改的框 -->
			<c:forEach items="${page.list }" var="s">
					<!-- 这边是修改的框 -->
					<div id="myModal${s.id }" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						  <div class="modal-header">
						    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						    <h3 id="myModalLabel">修改类别名称</h3>
						  </div>
						  <form id="myform2" action="typeedit.jspx" method="post" style="margin-bottom:0px">
							  <div class="modal-body">
							   <p>新类别名称：</p>
							    	<input type="hidden" name="myid" value="${s.id }">
									<textarea id="mytext" name="typename" style="width:511px;height:56px;"  placeholder="${s.typename }"></textarea>
							  </div>
							  <div class="modal-footer">
							    <button class="btn" data-dismiss="modal" aria-hidden="true" style="font-weight:bold;">取消</button>
							    <button id="btn2" class="btn btn-primary" style="font-weight:bold;" type="submit">修改类别</button>
							  </div>
						  </form>
					</div>
					
				</c:forEach>


<!--下面的东西-->
			<div class="container" style="margin-top:5px;">
			  <div class="row-fluid">
			   	
			   	<%@ include file="include/left.jsp" %>
			   	
			    <!--right-->
			    <div class="span9" style="float:right;margin-right:20px;border-radius: 10px;background-color:#fff;margin-left:20px;">
			      
				      
				        
				       <div class="header">
					           
					        <h1 class="page-title" style="margin-left:10px;margin-top:10px;margin-bottom:5px;">Home</h1>
					    </div>

					    <hr style="margin:0px;margin-bottom:3px;"/>
					    <ul class="breadcrumb">
					    	<li><a href="" title="">Home</a> <span class="divider">/</span></li>
					       	<li>类别管理 <span class="divider">/</span></li>
					         <li class="active">类别列表</li>
					    </ul>
					    <hr style="margin:0px;margin-bottom:3px;margin-top:3px;"/>
					        <div class="container-fluid">
					            <div class="row-fluid">
					                    

						        	<div style="padding:0px 10px;">
				    				<a type="btn" href="addtype.jspx" class="btn btn-success"><i class="icon-plus icon-white"></i>添加新类别</a>
				    				<a type="btn" class="btn btn-primary"><i class="icon-plus icon-white"></i>从Excel中导入</a>
				    				<a type="btn" class="btn btn-info"><i class="icon-plus icon-white"></i>导出为Excel</a>
				    				
				    			</div>
				    			<c:if test="${param.state==1001 }">
				    				<div class="alert alert-error" style="margin-top:10px;">
						              <button type="button" class="close" data-dismiss="alert">×</button>
						              <strong>Oh 有点小问题!</strong> 该类别所属有书籍哦。。请查明再删除！！
						            </div>
				    			</c:if>
								

				    			<div style="padding:10px;border:1px solid #CCCCCC;margin-top:10px;">
				    				<table class="table table-hover" style="margin-top:15px;">
				    					<thead>
				    						<tr>
				    							<th style="width:100px;">#</th>
				    							<th>类别名称</th>
				    							
				    							<th style="width:30px;">编辑</th>
				    							<th style="width:30px;">删除</th>
				    						</tr>
				    					</thead>
				    					<tbody>
				    						<c:forEach items="${page.list }" var="s" varStatus="vs">
				    							<tr>
					    							<td>${vs.count }</td>
					    							<td>${s.typename }</td>
					    							<td><a href="#myModal${s.id }" role="button"  data-toggle="modal" title=""><i class="icon-edit"></i></a></td>
					    							<td><a class="dela" href="javascript:;" title="" rel="${s.id }"><i class="icon-remove"></i></a></td>
					    						</tr>
				    						</c:forEach>
				    						<c:if test="${empty page.list }">
				    							<tr>
					    							<td colspan="3">还没有任何数据，请添加！！</td>
					    						</tr>
				    						</c:if>
				    						
				    						
				    					</tbody>
				    				</table>
				    			</div>
				    			
				    			
								<!-- 这边是分页效果 -->
								
								
				    			<div class="pagination" style="float:right;margin-right:70px;margin-top:20px;">
								  <ul>
								  	<c:choose>
								  		<c:when test="${page.nowPageNum == 1 }">
								  			<li class="disabled"><a href="#">首页</a></li>
								  		</c:when>
								  		<c:otherwise>
								  			<li><a href="typelist.jspx?p=1">首页</a></li>
								  		</c:otherwise>
								  	</c:choose>
								  	
							<c:forEach items="${solid }" var="s">
									<c:choose>
										<c:when test="${page.nowPageNum == s }">
											<li class="disabled"><a href="#">${s }</a></li>
										</c:when>
										<c:otherwise>
											<li><a href="typelist.jspx?p=${s }">${s }</a></li>
										</c:otherwise>					
									</c:choose>
							</c:forEach>
									<c:choose>
										<c:when test="${page.nowPageNum == page.totalpage}">
											<li class="disabled"><a href="#">尾页</a></li>
										</c:when>
										<c:otherwise>
											<li><a href="typelist.jspx?p=${page.totalpage }">尾页</a></li>
										</c:otherwise>
									</c:choose>
									
							 	</ul>
							</div>
		
						       <footer>
						          <hr>
						          <font>© 2012-2013 <i class="icon-hand-right"></i> 夼趸蒋</font>
						      </footer>
					                    
					            </div>
					        </div>
					    </div>

				     
			    </div>
			  </div>
			</div>

			</div>

			




	<script src="../js/jquery.js" type="text/javascript" ></script>
   	<script src="../js/bootstrap.min.js" type="text/javascript" ></script>
   	<script type="text/javascript">
   		
   		$(document).ready(function(){
   			$(".collapse").collapse();
   			
   			$(".dela").click(function(){
   				var id = $(this).attr("rel");
   				if(confirm("您真的要删除嘛？")){
   					location.href = "typeedit.jspx?id="+id;
   				}
   				
   			}); 
   		});
   	</script>
</body>
</html>